<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('出院结算列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>app_id：</label>
                                <input type="text" name="appId"/>
                            </li>
                            <li>
                                <label>用户名：</label>
                                <input type="text" name="synUserName"/>
                            </li>
                            <li>
                                <label>效验码：</label>
                                <input type="text" name="synKey"/>
                            </li>
                            <li>
                                <label>住院号：</label>
                                <input type="text" name="inHosNo"/>
                            </li>
                            <li>
                                <label>支付类型：</label>
                                <select name="payType" th:with="type=${@dict.getType('his_pay_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>支付交易流水号：</label>
                                <input type="text" name="payRecord"/>
                            </li>
                            <li>
                                <label>支付金额：</label>
                                <input type="text" name="payMoney"/>
                            </li>
                            <li>
                                <label>医保统筹金额：</label>
                                <input type="text" name="overMoney"/>
                            </li>
                            <li>
                                <label>社保卡号：</label>
                                <input type="text" name="socialsecurityNO"/>
                            </li>
                            <li>
                                <label>医保卡类型：</label>
                                <select name="medicareType" th:with="type=${@dict.getType('his_medicare_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>医保返回信息：</label>
                                <input type="text" name="medicareReturn"/>
                            </li>
                            <li class="select-time">
                                <label>创建时间：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreatTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreatTime]"/>
                            </li>
                            <li>
                                <label>支付状态：</label>
                                <input type="text" name="successfulPayment"/>
                            </li>
                            <li>
                                <label>支付交易流水号：</label>
                                <input type="text" name="outTradeNo"/>
                            </li>
                            <li>
                                <label>微信订单号：</label>
                                <input type="text" name="transactionId"/>
                            </li>
                            <li>
                                <label>银行返回信息：</label>
                                <input type="text" name="bankReturn"/>
                            </li>
                            <li>
                                <label>医院出院流水号：</label>
                                <input type="text" name="clearingNo"/>
                            </li>
                            <li>
                                <label>患者姓名：</label>
                                <input type="text" name="patientName"/>
                            </li>
                            <li>
                                <label>患者性别：</label>
                                <select name="patientSex" th:with="type=${@dict.getType('sys_user_sex')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li class="select-time">
                                <label>住院日期：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginInHosDate]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endInHosDate]"/>
                            </li>
                            <li>
                                <label>住院状态：</label>
                                <select name="inHosState" th:with="type=${@dict.getType('his_inHos_state')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>床号：</label>
                                <input type="text" name="bedNo"/>
                            </li>
                            <li>
                                <label>科室编码：</label>
                                <input type="text" name="departmentOrganId"/>
                            </li>
                            <li>
                                <label>科室名称：</label>
                                <input type="text" name="departmentName"/>
                            </li>
                            <li>
                                <label>出院温馨提醒：</label>
                                <input type="text" name="reminder"/>
                            </li>
                            <li>
                                <label>his接口返回信息：</label>
                                <input type="text" name="resultMsg"/>
                            </li>
                            <li>
                                <label>his接口返回信息：</label>
                                <input type="text" name="resultCode"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="his:leaveHosPay:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="his:leaveHosPay:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="his:leaveHosPay:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="his:leaveHosPay:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('his:leaveHosPay:edit')}]];
        var removeFlag = [[${@permission.hasPermi('his:leaveHosPay:remove')}]];
        var payTypeDatas = [[${@dict.getType('his_pay_type')}]];
        var medicareTypeDatas = [[${@dict.getType('his_medicare_type')}]];
        var successfulPaymentDatas = [[${@dict.getType('his_payment_state')}]];
        var patientSexDatas = [[${@dict.getType('sys_user_sex')}]];
        var inHosStateDatas = [[${@dict.getType('his_inHos_state')}]];
        var prefix = ctx + "his/leaveHosPay";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "出院结算",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: 'null',
                    visible: false
                },
                {
                    field: 'appId',
                    title: 'app_id'
                },
                {
                    field: 'synUserName',
                    title: '用户名'
                },
                {
                    field: 'synKey',
                    title: '效验码'
                },
                {
                    field: 'inHosNo',
                    title: '住院号'
                },
                {
                    field: 'payType',
                    title: '支付类型',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(payTypeDatas, value);
                    }
                },
                {
                    field: 'payRecord',
                    title: '支付交易流水号'
                },
                {
                    field: 'payMoney',
                    title: '支付金额'
                },
                {
                    field: 'overMoney',
                    title: '医保统筹金额'
                },
                {
                    field: 'socialsecurityNO',
                    title: '社保卡号'
                },
                {
                    field: 'medicareType',
                    title: '医保卡类型',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(medicareTypeDatas, value);
                    }
                },
                {
                    field: 'medicareReturn',
                    title: '医保返回信息'
                },
                {
                    field: 'creatTime',
                    title: '创建时间'
                },
                {
                    field: 'successfulPayment',
                    title: '支付状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(successfulPaymentDatas, value);
                    }
                },
                {
                    field: 'outTradeNo',
                    title: '支付交易流水号'
                },
                {
                    field: 'transactionId',
                    title: '微信订单号'
                },
                {
                    field: 'bankReturn',
                    title: '银行返回信息'
                },
                {
                    field: 'clearingNo',
                    title: '医院出院流水号'
                },
                {
                    field: 'patientName',
                    title: '患者姓名'
                },
                {
                    field: 'patientSex',
                    title: '患者性别',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(patientSexDatas, value);
                    }
                },
                {
                    field: 'inHosDate',
                    title: '住院日期'
                },
                {
                    field: 'inHosState',
                    title: '住院状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(inHosStateDatas, value);
                    }
                },
                {
                    field: 'bedNo',
                    title: '床号'
                },
                {
                    field: 'departmentOrganId',
                    title: '科室编码'
                },
                {
                    field: 'departmentName',
                    title: '科室名称'
                },
                {
                    field: 'reminder',
                    title: '出院温馨提醒'
                },
                {
                    field: 'resultMsg',
                    title: 'his接口返回信息'
                },
                {
                    field: 'resultCode',
                    title: 'his接口返回信息'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>